//package top.leix.springdemo.config;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//import top.leix.springdemo.intercepter.TokenInterceptor;
//import java.util.ArrayList;
//import java.util.List;
//@Component
//public class IntercepterConfig implements WebMvcConfigurer {
//    private TokenInterceptor tokenInterceptor;
//    //构造方法
//    public IntercepterConfig(TokenInterceptor tokenInterceptor){
//        this.tokenInterceptor = tokenInterceptor;
//    }
//    @Override
//    public void addInterceptors(InterceptorRegistry registry){
//        registry.addInterceptor(tokenInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns("/login/**"); //放行登录
//        //除了登陆接口其他所有接口都需要token验证
//        WebMvcConfigurer.super.addInterceptors(registry);
//
//    }
//}